import request from './request'

/* 首页接口 */
export const getSwiper=()=>{
  let data= request({url:'public/v1/home/swiperdata'})
  return data
}
export const getNav=()=>{
  let data=request({url:'public/v1/home/catitems'})
  return data
}
export const getFloor=()=>{
  let data=request({url:'public/v1/home/floordata'})
  return data
}

/* 分类页接口 */
export const getCate=()=>{
  let data=request({url:'public/v1/categories'})
  return data
}
export const getList=(params)=>{
  let data=request({url:'public/v1/goods/search',data:params})
  return data
}
export const getDetail=(params)=>{
  let data=request({url:'public/v1/goods/detail',data:params})
  return data
}

/* 搜索 */
export const getSearch=(params)=>{
  let data=request({url:'public/v1/goods/qsearch',data:params})
  return data
}

/* 登录 */
export const login=(params)=>{
  let data=request({url:'public/v1/users/wxlogin',method:'post',data:params})
  return data
}

/* 订单 */
export const getOrder=(params)=>{
  let data=request({url:'public/v1/my/orders/all?type='+params})
  return data
}
export const createOrder=(params)=>{
  let data=request({url:'public/v1/my/orders/create',method:'post',data:params})
  return data
}
export const payOrder=(params)=>{
  let data=request({url:'public/v1/my/orders/req_unifiedorder',method:'post',data:params})
  return data
}
export const payStatus=(params)=>{
  let data=request({url:'public/v1/my/orders/chkOrder',method:'post',data:params})
  return data
}